package com.example.demo.common.result;
public class UniformException extends RuntimeException{
    private final Integer code;
    private final String message;


    public UniformException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }


    public UniformException(ResultCode exceptionEnum) {
        this(exceptionEnum.getCode(), exceptionEnum.getMessage());
    }

    public UniformException(ResultMessage resultMessage) {
        this(999, resultMessage.getMessage());
    }
    public UniformException(String resultMessage) {
        this(999, resultMessage);
    }


    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
